package com.leiyk.rateLimiter.exception;

import lombok.Builder;
import lombok.Data;

/**
 * @Description: 限流异常类
 * @Author: leiyk6
 * @Date: 2024/7/4 16:50
 */
@Data
@Builder
public class RateLimiterException extends RuntimeException{
    public String code;

    public String msg;

    public static  RateLimiterException rejectRequest(){
        return RateLimiterException.builder().code("1001").msg("请求过快，稍后重试").build();
    }
}
